package com.qing.seckill.result;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class MyException {

	@ExceptionHandler(value = RuntimeException.class)
	public Object handler(Exception exception) {
		return Result.fail(exception.getMessage());
	}
}
